﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ColorLife.Core.Helper;
using DLUProject.Domain;
using DLUProject.Services;
public partial class QuanLyKTX_SinhVien_CTSinhVien : BaseUserControl
{
  
    public SinhVienExtension _sinhVienExt { get; set; }
    public SinhVienPhongModel Model { get; set; }
   
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    public int IDSinhVien
    {
        get
        {
            if (Request.QueryString["id"] != null)
                return Server.UrlEncode(Request.QueryString["id"]).ToInt();
            return -1;
        }
    }
    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);
        if (!IsPostBack)
        {
            Model = _sinhVienExt.GetThongTinSinhVien(IDSinhVien);
            if(Model==null)
            {
                Response.Redirect("Default.aspx");
            }
            if (Model.Phong == null)
            {
                lblThongTinPhong.Text = "Sinh vien này chưa được xếp phòng.";
            }
            lblThongTinPhong.Text = Model.Phong.TenPhong + " Nhà: " + Model.Phong.KhuNha.TenKhuNha;
        }
    }
}